< previous page page_104 next page >

Page 104
    DWORD    usri2_units_per_week;
    PBYTE    usri2_logon_hours;
    DWORD    usri2_bad_pw_count;
    DWORD    usri2_num_logons;
    LPWSTR   usri2_logon_server;
    DWORD    usri2_country_code;
    DWORD    usri2_code_page;
}
Is that a structure or what?
As large as the structure is, there are only three types of fields: pointers to Unicode strings, Long values, and a single PBYTE parameter. We'll get to that last one in a moment.
I won't even try to describe all of these fieldsyou'll have to read about them in the documentation for yourself. The important thing to know is that, in the vast majority of cases, you can simply pass NULL or 0 values in order to accept the default values. That means that, if I could define all of the fields as Long values, I would have the option of leaving the parameters at 0 to use the default values and could explicitly set the fields to an address as needed. This sounded so tempting that I defined the following VB declaration for the structure, adding a comment so I would know which fields needed to be strings:
Private Type USER_INFO_2
    usri2_name As Long ' Unicode string
    usri2_password As Long ' Unicode string
    usri2_password_age As Long
    usri2_priv As Long
    usri2_home_dir As Long ' Unicode string
    usri2_comment As Long ' Unicode string
    usri2_flags As Long
    usri2_script_path As Long ' Unicode string
    usri2_auth_flags As Long
    usri2_full_name As Long ' Unicode string
    usri2_usr_comment As Long ' Unicode string
    usri2_parms As Long ' Unicode string
    usri2_workstations As Long ' Unicode string
    usri2_last_logon As Long
    usri2_last_logoff As Long
    usri2_acct_expires As Long
    usri2_max_storage As Long
    usri2_units_per_week As Long
    usri2_logon_hours As Long ' Byte pointer to 168-bit number
    usri2_bad_pw_count As Long

 
< previous page page_104 next page >